home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 3
/
Gold Medal Software - Volume 3 (Gold Medal) (1994).iso
/
graphics
/
3dvect30.arj
/
OBJECTS.INC
< prev
next >
Wrap
Text File
|
1993-11-18
|
28KB
|
720 lines
; include knight.inc
setupbase:
mov objbase[0*4],offset headercube4
mov objbase[1*4],offset headercube2
mov objbase[2*4],offset headerring
mov objbase[3*4],offset headerdiamond
mov objbase[4*4],offset headerrubine
mov objbase[5*4],offset headercube3
mov objbase[6*4],offset headercube4
; mov objbase[0*4],offset headerknight
mov esi,0 ; from object #
mov edi,6 ; to object #
call set_up_all_lambert ; find and set up shading tables
ret
; shape data can be almost as large as you need it 'till it crashes. try a cube
; 20000x20000x20000. calculations use 32 bit registers and can handle
; up to 16 bit locations. keeping the object size small will allow a larger
; visible space. but larger objects will allow you to get closer with more
; accuracy in the mathematics of rotations. remember, if you make a really big
; object, set minz to the largest object on the screen so the large object wont
; mess up when you get really close to it.
;
; format for objects:
;
; thing:
; dw xx ; number of points
; dw yy ; number of surfaces
; dw 25 dup (?) ; 25 future use words
;
; dw xx,yy,zz ; x,y,z of point 0
; dw xx,yy,zz ; x,y,z of point 1
; dw xx,yy,zz ; x,y,z of point 2
; ...
;
; dw command
; dw texture for side 1
; dw texture for side 2
; dw colour for side 1
; dw colour for side 2
; dw connection data eg (1,2,3,4,1)
; dw [?,?,?] [optional surface normal if command 128 used]
; dw more connection data...
;
; to re-cap: dw command,texture1,texture2,colour1,colour2,connection,[0,0,0]
;
; list of command bits to date: (options grouped by function:)
;
; note: "visible" = "points appear counter-clockwise"
;
; texture definitions:
;
; 0 - normal surface, no features, constant colour.
; wavey - steel texture for surface 0 = none, colour offset determines
; screen offset for texture. eg 16+7 will use colour block 16-31
; but make the sine wave texture 14 (7*2) lines down. this is so
; all sine wave textures do not appear on the same line.
; windows and engines look good with this feature.
; shade - lambert shading bit, must have normal calculated or at least
; have free space for pre_cal_lambert to use:
; eg x,x,x,x,x,1,2,3,1,?,?,?<- these 3 words are surface normal!
; inverse - inversion bit for shading option. 0=normal shading, 1=inverse
; inversion automatically occures when other side is displayed.
; glow - =shade+inverse
; last - colour has same colour as previous surface (used when
; you want gourad shading, but want to avoid duplicate
; calculations - don't set gourad bit if this is what
; you use it for.) when this is used, the colour number
; determines the new colour block to use. the shading
; of this colour will be the same as the surface before
; it, but the colour block can be different.
;
; commands:
;
; point - defines a single point; must be repeated! eg dw 64,col,3,3
; line - if used, defines a line (must be set to define a true line)
; himap - if set, defines a bitmap,eg: point #, bitmap #, x scale,y scale
; lomap - uses 1/4 scaled bitmap (every 4'th pixel is sampled), fast
;
; iterate - generate iteration if side visible (iteration = sub-object)
; matrix - modify matrix when generating iteration. matrix object
; offset is 3rd word (6'th byte) in future use words.
;
; both - side is always visible no matter angle, skips counter-clowise test
; - "both sides have same texture"
; double - side is always visible but other side has other colour
; "double sided surface"
; note: if this is used, option "both" must not be used!!
; onscr - test if side is on screen - don't use if all points are
; outside clipping parameters.
; check - dont plot this side, just use as test points for visibility.
; this is mostly used with iterations.
;
; there are two kinds of bitmaps and points. those which are inside objects
; and those which are seperate objects themselves. if userotate object command
; is set to 32 or 64, then the entire object is considered to be either a point
; or bitmap. but if userotate is not set this way, then a normal object is
; drawn and bitmaps then come from within the object definitions (below). this
; way, bitmaps and points can be either part of a larger object, or they are
; computed fast on their own. (eg explosions and bullets as seperate objects)
;
; note: when writing surface descriptions, try to make the first value unique
; from any other first value. this way, the sort routine will give a more
; accurate sorting of sides. eg 1,3,6,1 2,4,1,2 rather than 1,3,6,1 1,2,4,1
;
; to recap:
;
; 0 = constant colour, only visible from counter-clockwise side
; wavey = sine texture
; shade = shading - requires 3 blank words for surface normal eg dw 0,0,0
; inverse = invert the shading direction, 0=normal, 1=sun is other way.
; last = use intensity from previous surface (not colour, only intensity)
;
; point = point
; line = line
; himap = bitmap (scalable, non-rotatable)
; lomap = bitmap (scalable, non-rotatable)
; iterate = generate iteration if side visible
; both = always visible
; double = always visible but other side has high byte colour,"double sided"
; onscr = plot side only if all the following points are on the screen
; check = dont plot side but use the following points as a test for visiblity
;
; what you can't mix on a single surface: "double" with "both"!!
;
; you do not have to define a point for the center of the object. the point
; 0 defines the center of the object. this is different from earlier versions
;
align 16
headercube1 dd -1
dd offset cube1a - offset $ - 4
cube1a dw 8 ; how many points
dw 6 ; how many surfaces
dw 25 dup (?) ; future use
; x y z
dw -70, 70, 70 ;1
dw -70,-70, 70 ;2
dw 70,-70, 70 ;3
dw 70, 70, 70 ;4
dw -70, 70,-70 ;5
dw -70,-70,-70 ;6
dw 70,-70,-70 ;7
dw 70, 70,-70 ;8
dw 0,?,?,16*9+12 ,? ,1,2,3,4,1 ; surface connection data, and colours
dw 0,wavey,?,16*7+6 ,? ,8,7,6,5,8 ; end point=start point means done side
dw 0,wavey,?,16*3+9 ,? ,4,3,7,8,4
dw 0,shade,?,16*5+0 ,? ,5,6,2,1,5 ,?,?,? ;<-- lambert shading